package com.prs.crm.dao.receipt.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.receipt.ReceiptMoudleTypeDao;
import com.prs.crm.domain.receipt.ReceiptMoudleType;

public class ReceiptMoudleTypeDaoImpl extends BaseDaoImpl<ReceiptMoudleType> implements ReceiptMoudleTypeDao{

	@SuppressWarnings("unchecked")
	@Override
	public List<ReceiptMoudleType> getAllReceiptMoudleType() {
		Criteria criteria=this.getSession().createCriteria(ReceiptMoudleType.class);
		return criteria.list();
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<ReceiptMoudleType> getReceiptMoudleType() {
		Criteria criteria=this.getSession().createCriteria(ReceiptMoudleType.class);
		criteria.add(Restrictions.isNull("parent"));
		return criteria.list();
	}

}
